home *** CD-ROM | disk | FTP | other *** search
/ Freelog 115 / FreelogNo115-MaiJuin2013.iso / Internet / Filezilla Server / FileZilla_Server-0_9_41.exe / source / interface / OptionsMiscPage.cpp < prev    next >
C/C++ Source or Header  |  2011-11-06  |  4KB  |  102 lines

  1. // FileZilla Server - a Windows ftp server
  2.  
  3. // Copyright (C) 2002-2004 - Tim Kosse <tim.kosse@gmx.de>
  4.  
  5. // This program is free software; you can redistribute it and/or
  6. // modify it under the terms of the GNU General Public License
  7. // as published by the Free Software Foundation; either version 2
  8. // of the License, or (at your option) any later version.
  9.  
  10. // This program is distributed in the hope that it will be useful,
  11. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13. // GNU General Public License for more details.
  14.  
  15. // You should have received a copy of the GNU General Public License
  16. // along with this program; if not, write to the Free Software
  17. // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  18.  
  19. // OptionsMisc.cpp: Implementierungsdatei
  20. //
  21.  
  22. #include "stdafx.h"
  23. #include "filezilla server.h"
  24. #include "OptionsDlg.h"
  25. #include "Options.h"
  26. #include "OptionsPage.h"
  27. #include "OptionsMiscPage.h"
  28.  
  29. #if defined(_DEBUG) && !defined(MMGR)
  30. #define new DEBUG_NEW
  31. #undef THIS_FILE
  32. static char THIS_FILE[] = __FILE__;
  33. #endif
  34.  
  35. /////////////////////////////////////////////////////////////////////////////
  36. // Dialogfeld COptionsMisc 
  37.  
  38.  
  39. COptionsMiscPage::COptionsMiscPage(COptionsDlg *pOptionsDlg, CWnd* pParent /*=NULL*/)
  40.     : COptionsPage(pOptionsDlg, COptionsMiscPage::IDD, pParent)
  41. {
  42.     //{{AFX_DATA_INIT(COptionsMiscPage)
  43.     m_bDontShowPass = FALSE;
  44.     m_bStartMinimized = FALSE;
  45.     m_TransferBufferSize = _T("");
  46.     m_bActiveIgnoreLocal = FALSE;
  47.     //}}AFX_DATA_INIT
  48. }
  49.  
  50.  
  51. void COptionsMiscPage::DoDataExchange(CDataExchange* pDX)
  52. {
  53.     COptionsPage::DoDataExchange(pDX);
  54.     //{{AFX_DATA_MAP(COptionsMiscPage)
  55.     DDX_Check(pDX, IDC_OPTIONS_MISC_DONTSHOWPASS, m_bDontShowPass);
  56.     DDX_Check(pDX, IDC_OPTIONS_MISC_STARTMINIMIZED, m_bStartMinimized);
  57.     DDX_Text(pDX, IDC_OPTIONS_TRANSFERBUFFERSIZE, m_TransferBufferSize);
  58.     DDV_MaxChars(pDX, m_TransferBufferSize, 6);
  59.     DDX_Text(pDX, IDC_OPTIONS_TRANSFERBUFFERSIZE2, m_TransferBufferSize2);
  60.     DDV_MaxChars(pDX, m_TransferBufferSize2, 8);
  61.     DDX_Check(pDX, IDC_SHAREWRITE, m_bSharedWrite);
  62.     DDX_Check(pDX, IDC_ACTIVE_IGNORELOCAL, m_bActiveIgnoreLocal);
  63.     //}}AFX_DATA_MAP
  64. }
  65.  
  66.  
  67. BEGIN_MESSAGE_MAP(COptionsMiscPage, COptionsPage)
  68.     //{{AFX_MSG_MAP(COptionsMiscPage)
  69.     //}}AFX_MSG_MAP
  70. END_MESSAGE_MAP()
  71.  
  72. /////////////////////////////////////////////////////////////////////////////
  73. // Behandlungsroutinen fⁿr Nachrichten COptionsMiscPage
  74.  
  75. BOOL COptionsMiscPage::OnInitDialog() 
  76. {
  77.     COptionsPage::OnInitDialog();
  78.     
  79.     return TRUE;  // return TRUE unless you set the focus to a control
  80.                   // EXCEPTION: OCX-Eigenschaftenseiten sollten FALSE zurⁿckgeben
  81. }
  82.  
  83. void COptionsMiscPage::LoadData()
  84. {
  85.     m_bDontShowPass = m_pOptionsDlg->GetOptionVal(OPTION_LOGSHOWPASS) == 0;
  86.     m_bStartMinimized = m_pOptionsDlg->m_pInterfaceOptions->GetOptionVal(IOPTION_STARTMINIMIZED) != 0;
  87.     m_TransferBufferSize.Format(_T("%d"), static_cast<int>(m_pOptionsDlg->GetOptionVal(OPTION_BUFFERSIZE)));
  88.     m_TransferBufferSize2.Format(_T("%d"), static_cast<int>(m_pOptionsDlg->GetOptionVal(OPTION_BUFFERSIZE2)));
  89.     m_bSharedWrite = m_pOptionsDlg->GetOptionVal(OPTION_SHAREDWRITE) != 0;
  90.     m_bActiveIgnoreLocal = m_pOptionsDlg->GetOptionVal(OPTION_ACTIVE_IGNORELOCAL) != 0;
  91. }
  92.  
  93. void COptionsMiscPage::SaveData()
  94. {
  95.     m_pOptionsDlg->SetOption(OPTION_LOGSHOWPASS, m_bDontShowPass?0:1);
  96.     m_pOptionsDlg->m_pInterfaceOptions->SetOption(IOPTION_STARTMINIMIZED, m_bStartMinimized);
  97.     m_pOptionsDlg->SetOption(OPTION_BUFFERSIZE, _ttoi(m_TransferBufferSize));
  98.     m_pOptionsDlg->SetOption(OPTION_BUFFERSIZE2, _ttoi(m_TransferBufferSize2));
  99.     m_pOptionsDlg->SetOption(OPTION_SHAREDWRITE, m_bSharedWrite ? 1 : 0);
  100.     m_pOptionsDlg->SetOption(OPTION_ACTIVE_IGNORELOCAL, m_bActiveIgnoreLocal ? 1 : 0);
  101. }
  102.